In a traditional database system, the transaction management protocols and mechanisms are constrained by the fundamental properties of atomicity, consistency, isolation and durability (ACID). The transaction atomicity, which is the cornerstone of a transaction management system, states that a transaction either runs completely or has no effect on the system at all. The atomicity property indirectly impacts a transaction's ability to view the effects of another transaction while it is executing (visibility) and the database system's ability to recover in case of a failure (recoverability).
In a typical database system, a transaction's ability to view another transaction's uncommitted data is controlled using read locks or multi-version read consistent views of data. Write locks protect a transaction's uncommitted data from being seen and modified by some other transaction. These write locks are held until the end of the transaction and this is required to ensure that the system is recoverable.
A transaction management system with strict ACID properties is effective for conventional database applications involving short execution times (short transactions) and relatively small number of concurrent transactions (operating on the same data). However, it is excessively restrictive for applications that involve reactive, long-lived, and complex transactions.
For example, a complex transaction may involve making the arrangements for a band's world tour. Such arrangements may involve booking many flights, hotels, arranging car rentals, dining, etc. Completing all of the arrangements may take weeks. If the entire “world tour” transaction is modeled using a single database transaction, then certain records may remain locked to other transactions for the entire duration. For example, a record that indicates how many seats are available on a particular flight may remain locked (preventing other passengers from booking seats on the same flight) until the “world tour” transaction either commits or fails.
Keeping records locked for the duration of complex business transactions is impractical and inefficient. However, if a complex business transaction is modeled using several independent database transactions, other problems may occur. For example, assume that a part of a particular business transaction involves increasing the funds in an account. Further assume that the fund increase operation is performed as a distinct database transaction that is allowed to commit before the entire business transaction completes. After the fund increase transaction commits, other transactions are able to see the increased funds in the account. One of those other transactions may be a “withdrawal” transaction that withdraws more funds from the account than existed in the account prior to the funds increase.
If the business transaction that performed the funds increase does not complete successfully, then it will be difficult to undo the changes made by the partially-performed business transaction. In the current example, decreasing the funds of the account to undo the fund increase will leave the account with a negative balance, due to the subsequent withdrawal transaction. To avoid a negative balance, the withdrawal transaction may have to be undone before the fund update transaction is undone. Undoing the withdrawal transaction may necessitate the rollback of one or more additional transactions that relied on the changes made by the withdrawal transaction. Situations like this, where aborting one transaction may necessitate aborting one or more subsequent transactions, are known as “cascading abort” situations. It is clearly desirable for transaction management systems to avoid cascading abort situations.